<template>
  <div id="cluereport">
    <el-dialog
      append-to-body
      :title="dialogtitle"
      :visible.sync="dialogVisible"
      width="98%" top="20px" :close-on-click-modal="false" :close-on-press-escape="false">
      <clueReportEdit @dialogHide="dialogHide($event)" :data="item" :readOnly="readonly" :timestamp="timestamp2" :hidePersonAll="true"></clueReportEdit>
    </el-dialog>
    <section class="wboxd" style="margin-top:10px" v-if="roleShow||roleShowAll">
      <!--列表-->
      <el-table :data="list" highlight-current-row v-loading="listLoading" style="width: 100%;" @sort-change='sortChange' border
        @selection-change="handleSelectionChange"
        ref="multipleTable"
        >
        <el-table-column type="index" label="序号" width="50" fixed align="center" class-name="tableth">
        </el-table-column>
        <el-table-column prop="source" label="来源" width="100" show-overflow-tooltip>
          <template slot-scope="scope">
            {{scope.row.sourceText}}<span v-if="scope.row.sourceText==='其他'">：{{scope.row.otherSource}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="fileNumber" label="文号" width="150" show-overflow-tooltip>
        </el-table-column>
        <el-table-column prop="registerDate" label="登记时间" width="110">
          <template slot-scope="scope">
            {{scope.row.registerDate}}
          </template>
        </el-table-column>
        <el-table-column prop="title" label="来文标题" show-overflow-tooltip>
        </el-table-column>
        <el-table-column label="反映问题分类" width="120" show-overflow-tooltip>
          <template slot-scope="scope">
            {{scope.row.caseClassText}}
          </template>
        </el-table-column>
        <el-table-column label="反映问题分类二" width="180">
          <template slot-scope="scope">
            <el-popover placement="top-start" width="400" trigger="hover" v-if="scope.row.disciplineClass.length>1">
              <div v-html="disciplineClassName(scope.row.disciplineClass,scope.row.otherDisciplineClass)">
              </div>
              <span slot="reference">{{disciplineClassName2(scope.row.disciplineClass[0])}}...</span>
            </el-popover>
            <span v-else>{{disciplineClassName2(scope.row.disciplineClass[0])}}</span>
            <span></span>
          </template>
        </el-table-column>
        <el-table-column prop="approveDate" label="批办时间" width="110">
          <template slot-scope="scope">
            {{scope.row.approveDate}}
          </template>
        </el-table-column>
        <el-table-column prop="nature" label="性质" width="100" show-overflow-tooltip>
          <template slot-scope="scope">
            {{scope.row.natureText}}
          </template>
        </el-table-column>
        <el-table-column prop="closingDate" label="办结时间" width="110">
          <template slot-scope="scope">
            {{scope.row.closingDate}}
          </template>
        </el-table-column>
        <el-table-column prop="status" label="当前状态" width="100">
          <template slot-scope="scope">
            {{scope.row.statusText}}
          </template>
        </el-table-column>
        <el-table-column label="操作" width="100">
          <template slot-scope="scope">
            <el-button @click="detail(scope.row)" style="color:#000 !important;margin:10px 0">查看</el-button>
          </template>
        </el-table-column>
      </el-table>
    </section>
  </div>
</template>

<script>
import clueReportEdit from './edit'
import clueReportDetail from './detail'
export default {
  components: {
    clueReportEdit,
    clueReportDetail
  },
  watch: {
    idcardNo: {
      handler (val) {
        if (val && val !== '') {
          this.getList()
        }
      },
      immediate: true
    },
    timestamp: {
      handler (newName, oldName) {
        console.log(newName)
        this.getList()
      },
      immediate: true
    }
  },
  props: {
    idcardNo: '',
    timestamp: ''
  },
  data () {
    return {
      timestamp2: '',
      exportLoading1: false,
      exportLoading2: false,
      roleShow: true,
      roleShowAll: true,
      roleAdmin: true,
      roleEdit: true,
      roleChart: true,
      settype: '',
      userRoles: [],
      setAuthText: '',
      roleSubmitLoading2: false,
      isIndeterminate2: false,
      roleSubmitLoading: false,
      role: [],
      checkAll2: false,
      checkAll: false,
      isIndeterminate: false,
      setRole: false,
      setrole0: false,
      // roles: [{label: '查看', value: 1}, {label: '编辑', value: 2}, {label: '分析', value: 3}],
      roles: ['查看', '编辑', '分析'],
      roles2: [],
      roleuser: [],
      userlist: [],
      clueReportId: '',
      roleForm: {
        id: '',
        clueReportId: '',
        authUserId: '',
        source: false,
        otherSource: false,
        fileNumber: false,
        registerDate: false,
        title: false,
        caseClass: false,
        disciplineClass: false,
        otherDisciplineClass: false,
        caseComment: false,
        unit: false,
        name: false,
        idCardNo: false,
        job: false,
        approveLeader: false,
        approveDate: false,
        approveMethod: false,
        verifyComment: false,
        nature: false,
        processMethod: false,
        otherProcessMethod: false,
        processOffice: false,
        otherProcessOffice: false,
        processComment: false,
        closingLeader: false,
        closingDate: false,
        sendRequired: false,
        status: false,
        amount: false,
        comment: false
      },
      drawer: false,
      authUser: '',
      authFlag: false,
      noRoleCode: '***',
      noRoleText: '***',
      filters: {
        source: '',
        fileNumber: '',
        caseClass: '',
        registerDaterange: [],
        approveDaterange: [],
        nature: '',
        title: '',
        disciplineClass: '',
        closingDaterange: [],
        status: ''
      },
      sourceDic: [],
      caseClassDic: [],
      natureDic: [],
      disciplineClassDic: [],
      statusDic: [],
      listLoading: false,
      ids: [],
      tableHeight: 100,
      list: [],
      pageNum: 1,
      pageSize: 20,
      totalnum: 0,
      item: {},
      dialogtitle: '新增',
      dialogVisible: false,
      readonly: false,
      testAddFormLoading: false,
      testAddForm: {
        UserName: '',
        PassWord: '',
        TrueName: '',
        UnitName: '',
        Enable: '停用'
      },
      total: 0,
      Isace: 'asc',
      Sortkey: '',
      changeSizeFlag: false,
      myloading: false
    }
  },
  methods: {
    fprocess (data) {
      this.$router.push({name: 'CadreHandling', params: {data: data}})
    },
    showchart () {
      this.$router.push('/cluereport/chart')
    },
    showlog () {
      this.$router.push('/cluereport/log')
    },
    geCurrUserRole () {
      this.$http.get(this.$http.defaults.selectionAPI + `api/busClueReportFuncAuth/geCurrUserFuncList`).then(response => {
        if (response.data.success) {
          this.roleShow = response.data.result.roleShow
          this.roleShowAll = response.data.result.roleShowAll
          this.roleAdmin = response.data.result.roleAdmin
          this.roleEdit = response.data.result.roleEdit
          this.roleChart = response.data.result.roleChart
        } else {
          console.log('获取失败:' + response.data.message)
          this.$message({
            message: '获取失败:' + response.data.message,
            type: 'error'
          })
        }
      })
    },
    handleCheckAllChange2 (val) {
      this.roles2 = []
      for (let item in this.roleForm) {
        if (item !== 'id' && item !== 'clueReportId' && item !== 'authUserId') {
          this.roles2.push(item)
        }
      }
      console.log(this.roles2)
      this.selected = val ? this.roles2 : []
      for (let item in this.roleForm) {
        if (item !== 'id' && item !== 'clueReportId' && item !== 'authUserId') {
          if (this.selected.indexOf(item) > -1) {
            this.roleForm[item] = true
          } else {
            this.roleForm[item] = false
          }
        }
      }
      this.isIndeterminate2 = false
    },
    roles2change () {
      this.selected = []
      this.roleForm.otherSource = this.roleForm.source
      this.roleForm.otherProcessMethod = this.roleForm.processMethod
      this.roleForm.otherProcessOffice = this.roleForm.processOffice
      this.roleForm.otherDisciplineClass = this.roleForm.disciplineClass
      for (let item in this.roleForm) {
        if (item !== 'id' && item !== 'clueReportId' && item !== 'authUserId' && this.roleForm[item]) {
          this.selected.push(item)
        }
      }
      console.log(this.selected)
      if (this.selected.length > 0) {
        this.isIndeterminate2 = true
      } else {
        this.isIndeterminate2 = false
      }
    },
    getRoles () {
      this.role = []
      this.isIndeterminate = false
      this.$http.get(this.$http.defaults.selectionAPI + `api/busClueReportFuncAuth/geUserFuncList?userId=` + this.roleuser[1]).then(response => {
        if (response.data.success) {
          let roleids = response.data.result
          for (let roleid of roleids) {
            this.role.push(this.roles[roleid - 1])
          }
          this.handleCheckedChange(this.role)
        } else {
          console.log('获取失败:' + response.data.message)
          this.$message({
            message: '获取失败:' + response.data.message,
            type: 'error'
          })
        }
      })
    },
    getRoles2 () {
      this.listLoading = true
      this.$http.get(this.$http.defaults.selectionAPI + `api/busClueReportAuth/getAuthByPerson?userId=` + this.roleuser[1]).then(response => {
        if (response.data.success) {
          this.$refs.multipleTable.clearSelection()
          let ids = []
          this.userRoles = response.data.result
          for (let item of this.userRoles) {
            for (let info of this.list) {
              if (item.clueReportId === info.id) {
                ids.push(info)
              }
            }
          }
          this.toggleSelection(ids)
          this.listLoading = false
        } else {
          this.listLoading = false
          console.log('获取失败:' + response.data.message)
          this.$message({
            message: '获取失败:' + response.data.message,
            type: 'error'
          })
        }
      })
    },
    toggleSelection (rows) {
      if (rows && rows.length > 0) {
        rows.forEach(row => {
          this.$refs.multipleTable.toggleRowSelection(row)
        })
      } else {
        this.$refs.multipleTable.clearSelection()
      }
    },
    submitRoles () {
      let roleids = []
      for (let item of this.role) {
        if (this.roles.indexOf(item) !== '-1') { roleids.push(this.roles.indexOf(item) + 1) }
      }
      // if (roleids.length === 0) {
      //   this.$message({
      //     message: '至少选择一项授权',
      //     type: 'warning'
      //   })
      //   return
      // }
      let para = {authUserId: this.roleuser[1], funcIds: roleids, funcType: 1}
      this.roleSubmitLoading = true
      this.$http.post(this.$http.defaults.selectionAPI + `api/busClueReportFuncAuth/saveUserFunc`, para).then(response => {
        this.roleSubmitLoading = false
        if (response.data.success) {
          this.$message({
            message: '提交成功',
            type: 'success'
          })
          this.setrole0 = false
        } else {
          this.$message({
            message: '提交失败:' + response.data.message,
            type: 'error'
          })
        }
      })
    },
    submitRoles2 () {
      let testflag = false
      for (let item in this.roleForm) {
        if (item !== 'id' && item !== 'id' && item !== 'id' && this.roleForm[item]) {
          testflag = true
          break
        }
      }
      if (!testflag) {
        this.$message({
          message: '至少选择一个字段',
          type: 'warning'
        })
        return
      }
      let insertList = []
      let updateList = []
      let removeList = []
      if (this.settype === 2) { // 批量授权模式
        console.log('settype2')
        for (let item of this.ids) { // 遍历所有选中纪录
          let insertObj = Object.assign({}, this.roleForm)
          insertObj.authUserId = this.roleuser[1]
          insertObj.clueReportId = item.id
          let insertOrUpdate = 'insert'
          for (let userRole of this.userRoles) {
            if (userRole.clueReportId === item.id) {
              insertObj.id = userRole.id
              insertOrUpdate = 'update'
              break
            }
          }
          if (insertOrUpdate === 'insert') {
            insertList.push(insertObj)
          } else if (insertOrUpdate === 'update') {
            updateList.push(insertObj)
          }
        }
        for (let userRole of this.userRoles) { // 遍历当前所选被授权用户的已授权纪录
          let delflag = true
          for (let item of this.ids) { // 遍历所有选中纪录
            if (userRole.clueReportId === item.id) {
              delflag = false
              break
            }
          }
          if (delflag) {
            removeList.push(userRole.id)
          }
        }
      } else if (this.settype === 1) {
        console.log('settype1:' + this.clueReportId)
        let insertObj = Object.assign({}, this.roleForm)
        insertObj.authUserId = this.roleuser[1]
        insertObj.clueReportId = this.clueReportId
        let insertOrUpdate = 'insert'
        for (let userRole of this.userRoles) {
          if (userRole.clueReportId === this.clueReportId) {
            insertObj.id = userRole.id
            insertOrUpdate = 'update'
            break
          }
        }
        if (insertOrUpdate === 'insert') {
          insertList.push(insertObj)
        } else if (insertOrUpdate === 'update') {
          updateList.push(insertObj)
        }
      }
      let para = {
        insertList: insertList,
        updateList: updateList,
        removeList: removeList
      }
      this.roleSubmitLoading2 = true
      this.$http.post(this.$http.defaults.selectionAPI + `api/busClueReportAuth/saveAuth`, para).then(response => {
        this.roleSubmitLoading2 = false
        if (response.data.success) {
          this.$message({
            message: '提交成功',
            type: 'success'
          })
          this.$refs.drawer.closeDrawer()
          this.getList()
        } else {
          this.$message({
            message: '提交失败:' + response.data.message,
            type: 'error'
          })
        }
      })
    },
    removeAuth () {
      let para = {
        authUserId: this.roleuser[1],
        clueReportId: this.clueReportId
      }
      this.removeAuthLoading2 = true
      this.$http.post(this.$http.defaults.selectionAPI + `api/busClueReportAuth/removeAuth`, para).then(response => {
        this.roleSubmitLoading2 = false
        if (response.data.success) {
          this.$message({
            message: '取消授权成功',
            type: 'success'
          })
          this.$refs.drawer.closeDrawer()
          this.getList()
        } else {
          this.$message({
            message: '取消授权失败:' + response.data.message,
            type: 'error'
          })
        }
      })
    },
    username (id) {
      for (let item of this.userlist) {
        for (let user of item.children) {
          if (user.value === id) { return user.label }
        }
      }
    },
    handleCheckAllChange (val) {
      this.role = val ? this.roles : []
      this.isIndeterminate = false
    },
    handleCheckedChange (value) {
      let checkedCount = value.length
      this.checkAll = checkedCount === this.roles.length
      this.isIndeterminate = checkedCount > 0 && checkedCount < this.roles.length
    },
    setRoleType () {
      if (this.roleuser[0] === 2) {
        this.setRole = true
        this.getRoles2()
      } else {
        this.setRole = false
        this.setrole0 = true
        this.getRoles()
      }
    },
    getuserlist () {
      this.$http.get(this.$http.defaults.selectionAPI + `api/selection/auth/getAuthUsers`).then(response => {
        if (response.data.success) {
          this.userlist = response.data.result
          // this.userlist.push({label: '司领导', value: -1})
          // this.userlist.push(response.data.result[1])
          // this.userlist.push({label: '监督处处内人员', value: -1})
        } else {
          console.log('获取失败:' + response.data.message)
          this.$message({
            message: '获取失败:' + response.data.message,
            type: 'error'
          })
        }
      })
    },
    setRoleForm (obj) {
      this.roleForm = {
        id: '',
        clueReportId: '',
        authUserId: '',
        source: false,
        otherSource: false,
        fileNumber: false,
        registerDate: false,
        title: false,
        caseClass: false,
        disciplineClass: false,
        otherDisciplineClass: false,
        caseComment: false,
        unit: false,
        name: false,
        idCardNo: false,
        job: false,
        approveLeader: false,
        approveDate: false,
        approveMethod: false,
        verifyComment: false,
        nature: false,
        processMethod: false,
        otherProcessMethod: false,
        processOffice: false,
        otherProcessOffice: false,
        processComment: false,
        closingLeader: false,
        closingDate: false,
        sendRequired: false,
        status: false,
        amount: false,
        comment: false
      }
      for (let item in this.roleForm) {
        if (item !== 'id' && item !== 'clueReportId' && item !== 'authUserId' && obj && obj[item]) {
          this.roleForm[item] = true
        }
      }
      console.log('obj')
      console.log(obj)
      this.roles2change()
    },
    setAuth (id) {
      console.log('setAuthId:' + id)
      if (id) {
        this.settype = 1 // 单条记录授权
        this.clueReportId = id
        this.drawer = true
        this.setAuthText = ''
        // 回显选定字段
        for (let item of this.userRoles) {
          if (item.clueReportId === id) {
            this.setRoleForm(item)
            break
          } else {
            this.setRoleForm()
          }
        }
      } else {
        this.settype = 2 // 多条记录批量授权
        if (this.ids.length > 0) {
          this.drawer = true
          this.setAuthText = '（批量授权会覆盖用户之前的授权记录）'
          this.setRoleForm()
        } else {
          this.$message({
            message: '请选择至少一条记录',
            type: 'warning'
          })
        }
      }
    },
    changeAuthFlag () {
      this.authFlag ? this.authFlag = false : this.authFlag = true
    },
    handleSelectionChange (val) {
      this.ids = val
    },
    del (id) {
      this.$confirm('确认删除该记录吗?', '提示', {
        type: 'error'
      }).then(() => {
        let ids = []
        ids.push(id)
        let para = {ids: ids}
        this.$http.post(this.$http.defaults.selectionAPI + `api/busClueReport/removeReport`, para).then(response => {
          if (response.data.success === true) {
            this.$message({
              message: '删除成功',
              type: 'success'
            })
          } else {
            console.log('删除失败:' + response.data.message)
            this.$message({
              message: '删除失败:' + response.data.message,
              type: 'error'
            })
          }
          this.getList()
        })
      }).catch(() => {
      })
    },
    dels () {
      if (this.ids.length > 0) {
        let ids = []
        for (let item of this.ids) {
          ids.push(item.id)
        }
        this.$confirm('确认删除已选记录吗?', '提示', {
          type: 'error'
        }).then(() => {
          let para = { ids: ids }
          this.$http.post(this.$http.defaults.selectionAPI + `api/busClueReport/removeReport`, para).then(response => {
            if (response.data.success === true) {
              this.$message({
                message: '删除成功',
                type: 'success'
              })
            } else {
              console.log('删除失败:' + response.data.message)
              this.$message({
                message: '删除失败:' + response.data.message,
                type: 'error'
              })
            }
            this.getList()
          })
        }).catch(() => {
        })
      } else {
        this.$message({
          message: '请选择至少一条记录',
          type: 'warning'
        })
      }
    },
    sourceName (code) {
      if (code === this.noRoleCode) { return this.noRoleText }
      for (let item of this.sourceDic) {
        if (item.value === code) {
          return item.label
        }
      }
    },
    natureName (code) {
      if (code === this.noRoleCode) { return this.noRoleText }
      for (let item of this.natureDic) {
        if (item.value === code) {
          return item.label
        }
      }
    },
    statusName (code) {
      if (code === this.noRoleCode) { return this.noRoleText }
      for (let item of this.statusDic) {
        if (item.value === code) {
          return item.label
        }
      }
    },
    // disciplineClassName (code) {
    //   if (code === this.noRoleCode) { return this.noRoleText }
    //   let label = ''
    //   for (let item of this.disciplineClassDic) {
    //     if (item.value === code) {
    //       label = item.label
    //     }
    //     if (item.children && item.children.length > 0) {
    //       for (let child of item.children) {
    //         if (child.value === code) {
    //           label = item.label + ' > ' + child.label
    //         }
    //       }
    //     }
    //     if (label !== '') { return label }
    //   }
    // },
    disciplineClassName (arr, othertext) {
      // if (arr === this.noRoleCode) { return this.noRoleText }
      let label = ''
      for (let item of arr) {
        for (let it of item) {
          if (it === item[0]) {
            label = label + this.disciplineClass2Name(it, othertext)
          } else {
            label = label + ' > ' + this.disciplineClass2Name(it, othertext)
          }
        }
        label = label + '<br>'
      }
      return label
    },
    disciplineClassName2 (codeArr) {
      let label = ''
      for (let item of this.disciplineClassDic) {
        if (item.value === codeArr[0]) {
          label = item.label
        }
        if (item.children && item.children.length > 0) {
          for (let child of item.children) {
            if (child.value === codeArr[1]) {
              label = item.label + ' > ' + child.label
            }
          }
        }
        if (label !== '') { return label }
      }
    },
    disciplineClass2Name (code, othertext) {
      for (let item of this.disciplineClassDic) {
        if (item.value === code) {
          if (item.label === '其他' && othertext && othertext !== '') {
            return item.label + '（' + othertext + '）'
          } else {
            return item.label
          }
        }
        if (item.children) {
          for (let it of item.children) {
            if (it.value === code) {
              if (it.label === '其他' && othertext && othertext !== '') {
                return it.label + '（' + othertext + '）'
              } else {
                return it.label
              }
            }
          }
        }
      }
    },
    caseClassName (code) {
      if (code === this.noRoleCode) { return this.noRoleText }
      for (let item of this.caseClassDic) {
        if (item.value === code) {
          return item.label
        }
      }
    },
    dialogHide (flag) {
      this.dialogVisible = false
      if (flag) {
        this.getList()
      }
    },
    detail (data) {
      this.readonly = true
      this.dialogtitle = '查看详情'
      this.item = data
      this.dialogVisible = true
      this.timestamp2 = new Date().getTime()
    },
    exportPrj (id) {
      var _this = this
      this.$confirm('确定结束起草?', '提示', {
        type: 'success'
      }).then(() => {
        this.myloading = true
        this.$http.post(`/api/prj/finishqicao/` + id).then(function (response) {
          if (response.data.success === true) {
            _this.$message({
              message: '操作成功',
              type: 'success'
            })
          } else {
            console.log('操作失败:' + response.data.message)
            _this.$message({
              message: '操作失败:' + response.data.message,
              type: 'error'
            })
          }
          _this.myloading = false
          _this.getPrj()
        })
      })
    },
    editPrj: function (id) {
      console.log('editid:' + id)
      this.$router.push({path: '/assess/edit/' + id})
    },
    handleSizeChange (val) {
      this.changeSizeFlag = true
      this.pageNum = 1
      this.pageSize = val
      this.getList()
    },
    handleCurrentChange (val) {
      if (this.changeSizeFlag === false) {
        this.pageNum = val
        this.getList()
      }
    },
    // 查询
    search () {
      this.pageNum = 1
      this.getList()
    },
    // 排序
    sortChange: function (column, prop, order) {
      this.Sortkey = column.prop
      if (column.order === 'ascending') {
        this.Isace = 'asc'
      } else {
        this.Isace = 'desc'
      }
      this.getList()
    },
    getList () {
      // this.idcardNo = '330102196806012142'
      this.listLoading = true
      // var personParams = { Page: 0, Pagenum: 20, Personname: '', Unitkey: '', Sortkey: '', Isace: true, timestamp: new Date().getTime() }
      this.$http
        .get(this.$http.defaults.selectionAPI + `api/busClueReport/queryByIdCard?idcard=` + this.idcardNo)
        .then(response => {
          if (response.data.success) {
            this.listLoading = false
            this.list = response.data.result
            for (let item of this.list) {
              item.disciplineClass = JSON.parse(item.disciplineClass)
            }
          } else {
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch(error => {
          this.$message({
            message: '网络获取失败111111:' + error,
            type: 'error'
          })
        })
    },
    delPrj (id) {
      var _this = this
      this.$confirm('确认删除该记录吗?', '提示', {
        type: 'error'
      }).then(() => {
        this.$http.post(`/api/prj/remove/` + id).then(function (response) {
          if (response.data.success === true) {
            _this.$message({
              message: '删除成功',
              type: 'success'
            })
          } else {
            console.log('删除失败:' + response.data.message)
            _this.$message({
              message: '删除失败:' + response.data.message,
              type: 'error'
            })
          }
          _this.getPrj()
        })
      }).catch(() => {
      })
    },
    getDics (code) {
      this.$http
        .get(this.$http.defaults.selectionAPI + `api/sysDict/getByCode?code=` + code)
        .then(response => {
          if (response.data.success) {
            switch (code) {
              case '01':
                this.sourceDic = response.data.result
                break
              case '02':
                this.caseClassDic = response.data.result
                break
              case '04':
                this.natureDic = response.data.result
                break
              case '14':
                this.disciplineClassDic = response.data.result
                // this.disciplineClassDic.unshift({value: null, label: '全部'})
                break
              case '07':
                this.statusDic = response.data.result
                break
            }
          } else {
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch(error => {
          console.log(error)
          this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
        })
    },
    getAllDics () {
      this.getDics('01')
      this.getDics('02')
      this.getDics('14')
      this.getDics('04')
      this.getDics('07')
    },
    statusid2name (id) {
      for (let i = 0; i < this.statusdic.length; i++) {
        if (this.statusdic[i].id === id) {
          return this.statusdic[i].name
        }
      }
    }
  },
  mounted () {
    this.geCurrUserRole()
    this.getuserlist()
    this.getAllDics()
    this.getList()
  }
}
</script>
<style>
#cluereport .el-drawer__wrapper{
  width: 100%;
  height: 100%;
  position: fixed !important;
  overflow: hidden;
}
  .wboxd .el-table th{
    font-weight: normal;
    background-image: linear-gradient(to bottom , #f8f8f8, #efefef);
  }
  .wboxd .el-table td, .el-table th{
    padding:0;
    font-size:var(--size14) !important;
    line-height: 20px;
    font-family: '宋体'
  }
  .tableth{
    background-image: linear-gradient(to bottom , #f8f8f8, #efefef);
    height:33px;
  }
  #testlist .wboxs{
    height:45px;
    padding-top:10px;
  }
</style>
<style scoped>
  #cluereport .el-button{
    color:#fff !important;
  }
  #cluereport h1{
    font-size:var(--size16) !important;
    font-weight: bolder;
    height: 30px;
    border-bottom: 1px solid #95B8E7;
    font-family: '宋体';
    line-height: 30px;
    color: #000;
    padding-left:10px;
    background-image: linear-gradient(to bottom , #EEF4FF, #E0ECFF);
    margin:0;
  }
  .el-pagination{
    float: left;
    padding:7px 10px;
  }
  #cluereport .wboxs{
    width: 100%;
    background: #fff;
    border: 1px solid #95B8E7;
    margin:0 10px;
    overflow: hidden;
    padding:0;
  }
  .wboxd{
    padding:0;
    width: calc(100% - 0px);
    background: #fff;
    border: 1px solid #95B8E7;
    margin:0 10px;
    overflow: hidden;
  }
</style>
